/*
 * @Descripttion : 
 * @version      : 
 * @Author       : zero
 * @Date         : 2021-06-04 16:58:22
 * @LastEditors  : zero
 * @LastEditTime : 2021-06-05 12:52:40
 */
import Vue from 'vue'
import Vuex from 'vuex'


Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        news: '我是全局的',
        account: '',
        blance: 0,
        betPoolN:1,
        betNumber:0 //用户投注的chips数量
    },
    mutations: {
        setnews (state, news) {
            state.news = news
        },
        //设置账户
        setAccount (state, account) {
            state.account = account
        },
        //设置余额
        setBlance (state, blance) {
            state.blance = blance
        },
        setBetPoolN(state,betPoolN){  //设置投注id   1 主胜 2 客胜 3 平
           state.betPoolN=betPoolN
        },
        setBetNumber(state,betNumber){ 
            console.log(betNumber)
            state.betNumber=betNumber
         }
    },
    actions: {
        setAccount ({ commit }, key) {
            commit('setAccount', key)
        },
        setBlance ({ commit }, key) {
            commit('setBlance', key)
        },
    },
    getters: {

    }
})